package com.jdls.tanhua.server;

import com.jdls.tanhua.dubbo.UserApi;
import com.jdls.tanhua.interceptor.UserHolder;
import com.jdls.tanhua.pojo.User;
import com.jdls.tanhua.pojo.UserInfo;
import com.jdls.tanhua.vo.HuanXinUserVo;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author 嘉德罗斯
 * @date 2021/10/30
 */
@Service
public class HuanxinServer {

    @DubboReference
    private UserApi userApi;

    //环信用户信息
    public HuanXinUserVo user() {
        Long id = UserHolder.getUserId();
        User user = userApi.findId(id);

        HuanXinUserVo huanXinUserVo = new HuanXinUserVo();
        huanXinUserVo.setUsername(user.getHxUser());
        huanXinUserVo.setPassword(user.getHxPassword());

        return huanXinUserVo;
    }
}
